<%@ Page Title="" Language="C#" MasterPageFile="~/Master/List.Master" AutoEventWireup="true"
    CodeBehind="Rosters.aspx.cs" Inherits="MTC.Web.Forms.Rosters" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register Src="../Controls/Menu.ascx" TagName="Menu" TagPrefix="uc1" %>
<%@ Register Src="../Controls/NavMenu.ascx" TagName="NavMenu" TagPrefix="uc3" %>
<%@ Register Assembly="DevExpress.Web.ASPxGridView.v9.1, Version=9.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dxwgv" %>
<%@ Register Assembly="DevExpress.Web.ASPxEditors.v9.1, Version=9.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dxe" %>
<%@ Register Assembly="DevExpress.Web.ASPxGridView.v9.1.Export, Version=9.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxGridView.Export" TagPrefix="dxwgv" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CPHeader" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="CPNav" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="CPMain" runat="server">
    <table width="100%">
        <tr>
            <td style="width: 598px">
                <table style="width: 99%">
                    <tr>
                        <td style="width: 156px">
                            <asp:Label ID="LblDateOfSchedule" runat="server" Text="Schedule Date"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="TxtDateofSchedule" runat="server"></asp:TextBox><cc1:CalendarExtender
                                ID="CalendarExtender1" runat="server" TargetControlID="txtDateofSchedule" Format="dd/MM/yyyy">
                            </cc1:CalendarExtender>
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 156px">
                            <asp:Label ID="LblShift" runat="server" Text="Shift"></asp:Label>
                        </td>
                        <td>
                            <asp:DropDownList ID="CboShift" runat="server" DataTextField="ShiftDescription" DataValueField="ShiftId">
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 156px">
                        </td>
                        <td>
                        </td>
                    </tr>
                </table>
            </td>
            <td valign="top">
                <asp:Button ID="BtnSelect" runat="server" Text="Load Roster"  Width="100%" 
                    onclick="BtnSelect_Click"/>
                <br />
                <asp:Button ID="BtnSetupRoster" runat="server" Text="Setup up a new roster"  
                    Width="100%" onclick="BtnSetupRoster_Click"/>
                <br />
                <asp:Button ID="BtnClearRoster" runat="server" Text="Clear current roster" 
                    Width="100%" onclick="BtnClearRoster_Click"/>
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <dxwgv:ASPxGridView ID="GrdRosters" runat="server" CssFilePath="~/App_Themes/BlackGlass/{0}/styles.css"
                    CssPostfix="BlackGlass" AutoGenerateColumns="False" 
                    KeyFieldName="ScheduleDriverTaxiId" Width="100%" DataSourceID="grdRostersDataSource">
                    <Styles CssFilePath="~/App_Themes/BlackGlass/{0}/styles.css" CssPostfix="BlackGlass">
                        <Header ImageSpacing="5px" SortingImageSpacing="5px">
                        </Header>
                    </Styles>
                    <Images ImageFolder="~/App_Themes/BlackGlass/{0}/">
                    </Images>
                    <Settings ShowGroupPanel="false" ShowFilterRow="false" />
                    <Columns>
                        <dxwgv:GridViewDataTextColumn FieldName="ScheduleId" VisibleIndex="0" Visible="False">
                        </dxwgv:GridViewDataTextColumn>
                        <dxwgv:GridViewDataTextColumn FieldName="ShiftId" VisibleIndex="1" Visible="False">
                        </dxwgv:GridViewDataTextColumn>
                        <dxwgv:GridViewDataTextColumn FieldName="ScheduleDate" VisibleIndex="2" Visible="False">
                        </dxwgv:GridViewDataTextColumn>
                        <dxwgv:GridViewDataTextColumn FieldName="DriverId" VisibleIndex="3" Visible="False">
                        </dxwgv:GridViewDataTextColumn>
                        <dxwgv:GridViewDataTextColumn FieldName="TaxiId" VisibleIndex="4" Visible="False">
                        </dxwgv:GridViewDataTextColumn>
                        <dxwgv:GridViewDataComboBoxColumn FieldName="Name" VisibleIndex="0">
                            <PropertiesComboBox ValueType="System.String" 
                                DataSourceID="cboDriverDataSource" TextField="Name" ValueField="DriverId">
                            </PropertiesComboBox>
                        </dxwgv:GridViewDataComboBoxColumn>
                        <dxwgv:GridViewDataTextColumn FieldName="PlateNumber" VisibleIndex="6" Visible="True" ReadOnly="true">
                        </dxwgv:GridViewDataTextColumn>
                        <dxwgv:GridViewDataTextColumn FieldName="ShiftDescription" VisibleIndex="7" Visible="True" ReadOnly="true">
                        </dxwgv:GridViewDataTextColumn>
                        <dxwgv:GridViewDataTextColumn FieldName="ScheduleDriverTaxiId" VisibleIndex="8" Visible="False">                        
                        </dxwgv:GridViewDataTextColumn>
                        <dxwgv:GridViewCommandColumn VisibleIndex="9">
                            <EditButton Visible="True">
                            </EditButton>
                            <DeleteButton Visible="True">
                            </DeleteButton>
                            <ClearFilterButton Visible="True">
                            </ClearFilterButton>
                        </dxwgv:GridViewCommandColumn>
                    </Columns>
                    <Settings ShowFilterRow="False" />
                    <SettingsBehavior ConfirmDelete="True" />
                </dxwgv:ASPxGridView>
                <dxwgv:ASPxGridViewExporter ID="GrdExport" runat="server" GridViewID="GrdRosters">
                </dxwgv:ASPxGridViewExporter>
                <asp:ObjectDataSource ID="grdRostersDataSource" runat="server" SelectMethod="GetASchedule" DeleteMethod="DeleteASchedule" UpdateMethod="UpdateASchedule"
                    TypeName="MTC.Web.Business.Schedule"></asp:ObjectDataSource>
                <asp:ObjectDataSource ID="cboDriverDataSource" runat="server" SelectMethod="GetDrivers" 
                    TypeName="MTC.Web.Business.DropDowns"></asp:ObjectDataSource>
            </td>
        </tr>
    </table>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="CPSideBar" runat="server">
    <uc3:NavMenu ID="NavMenu1" runat="server" />
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="CPFooter" runat="server">
</asp:Content>
